#include "include/b+.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

/*
{
    INT 
    DOUBLE
    CHAR(12)
} 
SIZE = 24
*/

int main(){
    
    KeyStruct keys[3];
    keys[0].flag = INT;
    strcpy(keys[0].name,"id");

    keys[1].flag = DOUBLE;
    strcpy(keys[1].name,"weight");

    keys[2].flag = CHAR;
    strcpy(keys[2].name,"name");

    FILE * testTable = fopen("./testTable.idb","a+");

    initBPFile(testTable,3,keys);

    void * data = malloc(24);

    * (int *) data = 3;
    * (double *)(((char *) data ) + 4) = 12.5;
    strcpy((((char *) data ) + 12),"hello");

    insertData(testTable,3,data,false);

    return 0;
}